Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Show Mode #12

Merged
merged 8 commits into from
May 11, 2022
Merged

Add Show Mode #12

merged 8 commits into from
May 11, 2022

Conversation

eliascarv
Copy link
Owner

@eliascarv eliascarv commented May 9, 2022

This PR adds Show Mode for the TruthTable type.
Once a Show Mode is set, it will be used to display all objects created after that.

Usage

julia> using TruthTables

julia> tt = @truthtable p && q
TruthTable
┌───────┬───────┬───────┐
│   p   │   q   │ p  q │
├───────┼───────┼───────┤
│ truetruetrue  │
│ falsetruefalse │
│ truefalsefalse │
│ falsefalsefalse │
└───────┴───────┴───────┘


julia> TruthTables.showmode!(:bit)
:bit

julia> tt
TruthTable
┌───┬───┬───────┐
│ p │ q │ p  q │
├───┼───┼───────┤
│ 111     │
│ 010     │
│ 100     │
│ 000     │
└───┴───┴───────┘


julia> TruthTables.showmode!(:letter)
:letter

julia> tt
TruthTable
┌───┬───┬───────┐
│ p │ q │ p  q │
├───┼───┼───────┤
│ T │ T │ T     │
│ F │ T │ F     │
│ T │ F │ F     │
│ F │ F │ F     │
└───┴───┴───────┘

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2022

Codecov Report

Merging #12 (9643c2a) into main (5de45f9) will decrease coverage by 0.51%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
- Coverage   96.87%   96.36%   -0.52%     
==========================================
  Files           3        4       +1     
  Lines          96      110      +14     
==========================================
+ Hits           93      106      +13     
- Misses          3        4       +1     
Impacted Files Coverage Δ
src/showmode.jl 92.30% <92.30%> (ø)
src/truthtable.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5de45f9...9643c2a. Read the comment docs.

@eliascarv eliascarv merged commit 99a7077 into main May 11, 2022
@eliascarv eliascarv deleted the showmode branch May 11, 2022 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants